home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / FILES.SWG / 0002_FILATTR2.PAS.pas < prev    next >
Pascal/Delphi Source File  |  1993-05-28  |  627b  |  34 lines

  1. {
  2. JOE DICKSON
  3.  
  4. > I was wondering if someone could tell me how to change the Time and Date
  5. > and maybe the Attribute of a File? Lets say I want to Change:
  6. > FileNAME.EXT 1024 01-24-93 12:33p A  to:
  7. > FileNAME.EXT 1024 01-01-93 01:00a AR
  8. }
  9.  
  10. Program change_sample_Files_attribs;
  11.  
  12. Uses
  13.   Dos;
  14.  
  15. Var
  16.   f    : File;
  17.   attr : Word;
  18.   time : LongInt;
  19.   DT   : datetime;
  20.  
  21. begin
  22.   assign(f, 'FileNAME.EXT');
  23.   DT.year  := 93;
  24.   DT.month := 1;
  25.   DT.day   := 1;
  26.   dt.hour  := 1;
  27.   dt.min   := 0;
  28.   dt.sec   := 0;
  29.   packtime(dt, time);
  30.   attr     := ReadOnly;
  31.   setftime(f, time);
  32.   setfattr(f, attr);
  33. end.
  34.